from PyQt5.QtWidgets import QDialog
from ui_reg import Ui_Reg
import requests
from network import Network


class RegWindow(QDialog, Ui_Reg):
    def __init__(self, parent=None):
        super(RegWindow, self).__init__(parent=parent)
        self.setupUi(self)
        self.regButton.clicked.connect(self.reg)

    def reg(self):
        if Network.reg(self.usernameLine.text(), self.passwordLine.text(), self.phoneLine.text(), self.addrLine.text()) == True:
            self.close()
